package com.chenjinyan.user.dao;

import com.chenjinyan.user.entity.RegionEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * dd
 *
 * @author chenjinyan
 * @version 1.0
 */
@Repository
public interface RegionRepository extends JpaRepository<RegionEntity, Long> {

    @Query(value = "SELECT ID,PROVINCE_ID,PROVINCE_NAME,CITY_ID,CITY_NAME,DISTRICT_ID,DISTRICT_NAME from lost_and_find_region WHERE PROVINCE_ID =?1 and CITY_ID =?2 and DISTRICT_ID =?3 ", nativeQuery = true)
    List<RegionEntity> findAreaName(Integer provinceId, Integer cityId, Integer districtId);

}
